#ifndef PROJECTMODEL_H
#define PROJECTMODEL_H
#include <QString>
#include <QVector>
#include <vector>
// #include <QMetaType>// Important，这个头文件

class ProjectModel
{
public:
    //构造函数需要传入父节点,如果为nullptr,说明父节点是root.
    ProjectModel(ProjectModel * parent = nullptr);

    QString title;

    //返回子节点数量
    int subsCount() const;

    void addSub(ProjectModel * sub);
    void addSub2(std::unique_ptr<ProjectModel> && sub);

    ProjectModel * parent();
    //写死用ProjectModel不行么?
    ProjectModel * getSub(int column) const;
     QVariant getSub2(int column) const;
    bool setData(int column, const QVariant &value);



 private:
    ProjectModel * m_parent;
     QVector<ProjectModel*> m_childItems;
    std::vector<std::unique_ptr<ProjectModel>> m_childItems2;
};

// Q_DECLARE_METATYPE(ProjectModel)

#endif // PROJECTMODEL_H
